function network(showTip) {
	
	return new Promise((resolve,reject)=>{
		uni.getNetworkType({
			complete: e => {
				let networkType = e.networkType || 'none';
				console.log('networkType', networkType)
				switch (networkType) {
					case 'none':
						showTip&&uni.showToast({
							icon: "none",
							title: "当前无网络，请检查您的网络链接",
							mask: true,
							duration:2500
						});
						resolve("none")
						break;
					case 'wifi':
					  //   uni.showToast({
					  //   	icon: "none",
					  //   	title: "当前为Wi-Fi环境,可以批量上传箱架号",
					  //   	mask: true,
							// duration:2500
					  //   });
						resolve("wifi")
					   break;
					case '2g':
					case '3g':
					case '4g':
					case '5g':
						showTip&&uni.showToast({
							icon: "none",
							title: "当前为非Wi-Fi环境，请注意流量消耗",
							mask: true,
							duration:3000
						});
						resolve("xg")
						break;
					default:
					   break;
				}
			}
		});
	})

}

export default network